package com.example.shirodemo.dto;

import java.io.Serializable;
import lombok.Data;

/**
 * @author 绫小路
 * @date 2020/12/31
 * @description
 */

@Data
public class ResponseResultPage<T> implements Serializable {

  private static final long serialVersionUID = 123L;
  private long timestamp;
  private int code;
  private String message;
  private int page;
  private int limit;
  private long total;
  private T data;

  public ResponseResultPage(int code, String message, int page, int limit, long total, T data) {
    this.timestamp = System.currentTimeMillis();
    this.code = code;
    this.message = message;
    this.page = page;
    this.limit = limit;
    this.total = total;
    this.data = data;
  }

  public ResponseResultPage(int code, int page, int limit, long total, T data) {
    this.timestamp = System.currentTimeMillis();
    this.code = code;
    this.page = page;
    this.limit = limit;
    this.total = total;
    this.data = data;
  }

  public ResponseResultPage(int code, String message) {
    this.timestamp = System.currentTimeMillis();
    this.code = code;
    this.message = message;
  }
}
